<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>心愿墙 - 社交许愿平台</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #6366f1;
            --primary-light: #a5b4fc;
            --primary-dark: #4338ca;
            --secondary: #ec4899;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --border-light: #e2e8f0;
            --radius: 12px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            --transition: all 0.3s ease;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.15rem;
            font-weight: 600;
            text-align: center;
            flex: 1;
        }
        
        .nav-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        
        .nav-btn:hover {
            background-color: var(--bg-light);
            color: var(--primary);
        }
        
        .add-wish-btn {
            background-color: var(--primary);
            color: white;
        }
        
        .add-wish-btn:hover {
            background-color: var(--primary-dark);
            color: white;
        }
        
        /* 分类筛选 */
        .category-filter {
            background-color: var(--bg-white);
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-light);
            overflow-x: auto;
            scrollbar-width: none;
        }
        
        .category-filter::-webkit-scrollbar {
            display: none;
        }
        
        .categories {
            display: flex;
            gap: 10px;
            white-space: nowrap;
        }
        
        .category-item {
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 0.85rem;
            background-color: var(--bg-light);
            color: var(--text-secondary);
            transition: var(--transition);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .category-item.active {
            background-color: var(--primary);
            color: white;
        }
        
        /* 许愿列表 */
        .wishes-list {
            padding: 12px 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        /* 许愿项样式 */
        .wish-item {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: var(--transition);
        }
        
        .wish-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        }
        
        /* 许愿内容 */
        .wish-content {
            padding: 16px;
        }
        
        .wish-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
        }
        
        .wish-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
        }
        
        .wish-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .user-info {
            flex: 1;
            min-width: 0;
        }
        
        .user-name {
            font-size: 0.95rem;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .wish-time {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }
        
        .wish-text {
            font-size: 0.95rem;
            line-height: 1.6;
            margin-bottom: 12px;
        }
        
        /* 许愿图片容器 */
        .wish-images {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(32%, 1fr));
            gap: 4px;
            margin-bottom: 12px;
        }
        
        .wish-image {
            aspect-ratio: 1;
            overflow: hidden;
            border-radius: 8px;
        }
        
        .wish-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: var(--transition);
        }
        
        .wish-image img:hover {
            transform: scale(1.05);
        }
        
        /* 许愿标签 */
        .wish-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 12px;
        }
        
        .wish-tag {
            padding: 2px 8px;
            background-color: rgba(99, 102, 241, 0.1);
            color: var(--primary);
            font-size: 0.75rem;
            border-radius: 4px;
        }
        
        /* 许愿目标 */
        .wish-goal {
            padding: 8px 12px;
            background-color: var(--bg-light);
            border-radius: 8px;
            margin-bottom: 12px;
            font-size: 0.9rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .goal-label {
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .goal-progress {
            color: var(--primary);
            font-weight: 500;
        }
        
        /* 操作按钮 */
        .wish-actions {
            display: flex;
            justify-content: space-around;
            padding: 8px 0;
            border-top: 1px solid var(--border-light);
        }
        
        .action-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            color: var(--text-secondary);
            font-size: 0.75rem;
            background: none;
            border: none;
            transition: var(--transition);
            padding: 4px 12px;
        }
        
        .action-btn i {
            font-size: 1rem;
        }
        
        .action-btn:hover {
            color: var(--primary);
        }
        
        .action-btn.supported {
            color: var(--secondary);
        }
        
        .action-btn.liked {
            color: #ef4444;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 65px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            text-decoration: none;
        }
        
        .nav-item i {
            font-size: 1.25rem;
            margin-bottom: 4px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 发布许愿浮动按钮 */
        .fab-button {
            position: fixed;
            right: 20px;
            bottom: 80px;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
            z-index: 999;
            transition: var(--transition);
            border: none;
        }
        
        .fab-button:hover {
            transform: scale(1.1);
            background-color: var(--primary-dark);
        }
        
        .fab-button i {
            font-size: 1.5rem;
        }
        
        /* 提示消息 */
        .toast-message {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 0.9rem;
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast-message.show {
            opacity: 1;
        }
        
        /* 加载更多 */
        .load-more {
            margin: 16px 0;
            padding: 12px;
            text-align: center;
            color: var(--primary);
            font-size: 0.9rem;
            background-color: var(--bg-white);
            border-radius: var(--radius);
            border: 1px solid var(--border-light);
            transition: var(--transition);
        }
        
        /* 空状态 */
        .empty-state {
            padding: 60px 20px;
            text-align: center;
            color: var(--text-secondary);
        }
        
        .empty-state i {
            font-size: 3rem;
            margin-bottom: 16px;
            color: var(--border-light);
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">心愿墙</div>
        <button class="nav-btn" id="searchBtn">
            <i class="fas fa-search"></i>
        </button>
    </div>
    
    <!-- 分类筛选 -->
    <div class="category-filter">
        <div class="categories">
            <div class="category-item active">
                <i class="fas fa-th"></i>
                <span>全部心愿</span>
            </div>
            <div class="category-item">
                <i class="fas fa-gift"></i>
                <span>礼物愿望</span>
            </div>
            <div class="category-item">
                <i class="fas fa-utensils"></i>
                <span>美食愿望</span>
            </div>
            <div class="category-item">
                <i class="fas fa-plane"></i>
                <span>旅行愿望</span>
            </div>
            <div class="category-item">
                <i class="fas fa-book"></i>
                <span>学习愿望</span>
            </div>
            <div class="category-item">
                <i class="fas fa-heart"></i>
                <span>情感愿望</span>
            </div>
            <div class="category-item">
                <i class="fas fa-users"></i>
                <span>社交愿望</span>
            </div>
        </div>
    </div>
    
    <!-- 许愿列表 -->
    <div class="wishes-list" id="wishesList">
        <!-- 无图许愿 -->
        <div class="wish-item">
            <div class="wish-content">
                <div class="wish-header">
                    <div class="wish-avatar">
                        <img src="https://picsum.photos/id/64/100/100" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <div class="user-name">星辰大海</div>
                        <div class="wish-time">今天 08:45</div>
                    </div>
                </div>
                
                <div class="wish-text">
                    下个月想参加城市马拉松比赛，希望能坚持训练，顺利完成全程！现在每天只能跑5公里，目标是能轻松跑完20公里。有没有一起训练的跑友呀？
                </div>
                
                <div class="wish-tags">
                    <span class="wish-tag">运动</span>
                    <span class="wish-tag">马拉松</span>
                    <span class="wish-tag">目标</span>
                </div>
                
                <div class="wish-goal">
                    <div class="goal-label">
                        <i class="fas fa-fire"></i>
                        <span>训练进度</span>
                    </div>
                    <div class="goal-progress">25% (5/20公里)</div>
                </div>
            </div>
            
            <div class="wish-actions">
                <button class="action-btn comment-btn" data-id="1">
                    <i class="far fa-comment"></i>
                    <span>24</span>
                </button>
                <button class="action-btn support-btn" data-id="1">
                    <i class="far fa-hand-holding-heart"></i>
                    <span>42</span>
                </button>
                <button class="action-btn like-btn" data-id="1">
                    <i class="far fa-heart"></i>
                    <span>89</span>
                </button>
                <button class="action-btn share-btn" data-id="1">
                    <i class="far fa-share-alt"></i>
                    <span>分享</span>
                </button>
            </div>
        </div>
        
        <!-- 单图许愿 -->
        <div class="wish-item">
            <div class="wish-content">
                <div class="wish-header">
                    <div class="wish-avatar">
                        <img src="https://picsum.photos/id/65/100/100" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <div class="user-name">夏日清风</div>
                        <div class="wish-time">昨天 15:30</div>
                    </div>
                </div>
                
                <div class="wish-text">
                    看中了这款相机很久了，希望下个月生日能收到！最近一直在学习摄影，想记录下生活中的美好瞬间。有没有摄影爱好者可以交流一下呀？
                </div>
                
                <div class="wish-images">
                    <div class="wish-image">
                        <img src="https://picsum.photos/id/119/300/300" alt="相机图片">
                    </div>
                </div>
                
                <div class="wish-tags">
                    <span class="wish-tag">礼物</span>
                    <span class="wish-tag">摄影</span>
                    <span class="wish-tag">生日</span>
                </div>
                
                <div class="wish-goal">
                    <div class="goal-label">
                        <i class="fas fa-money-bill-wave"></i>
                        <span>目标金额</span>
                    </div>
                    <div class="goal-progress">65% (3250/5000元)</div>
                </div>
            </div>
            
            <div class="wish-actions">
                <button class="action-btn comment-btn" data-id="2">
                    <i class="far fa-comment"></i>
                    <span>56</span>
                </button>
                <button class="action-btn support-btn supported" data-id="2">
                    <i class="fas fa-hand-holding-heart"></i>
                    <span>128</span>
                </button>
                <button class="action-btn like-btn" data-id="2">
                    <i class="far fa-heart"></i>
                    <span>215</span>
                </button>
                <button class="action-btn share-btn" data-id="2">
                    <i class="far fa-share-alt"></i>
                    <span>分享</span>
                </button>
            </div>
        </div>
        
        <!-- 三图许愿 -->
        <div class="wish-item">
            <div class="wish-content">
                <div class="wish-header">
                    <div class="wish-avatar">
                        <img src="https://picsum.photos/id/91/100/100" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <div class="user-name">咖啡不加糖</div>
                        <div class="wish-time">3天前</div>
                    </div>
                </div>
                
                <div class="wish-text">
                    计划今年夏天去日本京都旅行，希望能看到美丽的樱花，品尝正宗的日式咖啡和甜点。有没有去过的朋友可以推荐一些小众景点和咖啡馆呀？
                </div>
                
                <div class="wish-images">
                    <div class="wish-image">
                        <img src="https://picsum.photos/id/240/300/300" alt="京都风景">
                    </div>
                    <div class="wish-image">
                        <img src="https://picsum.photos/id/431/300/300" alt="日式咖啡">
                    </div>
                    <div class="wish-image">
                        <img src="https://picsum.photos/id/292/300/300" alt="日式甜点">
                    </div>
                </div>
                
                <div class="wish-tags">
                    <span class="wish-tag">旅行</span>
                    <span class="wish-tag">日本</span>
                    <span class="wish-tag">美食</span>
                </div>
                
                <div class="wish-goal">
                    <div class="goal-label">
                        <i class="fas fa-calendar-check"></i>
                        <span>计划日期</span>
                    </div>
                    <div class="goal-progress">7月15日出发</div>
                </div>
            </div>
            
            <div class="wish-actions">
                <button class="action-btn comment-btn" data-id="3">
                    <i class="far fa-comment"></i>
                    <span>89</span>
                </button>
                <button class="action-btn support-btn" data-id="3">
                    <i class="far fa-hand-holding-heart"></i>
                    <span>76</span>
                </button>
                <button class="action-btn like-btn liked" data-id="3">
                    <i class="fas fa-heart"></i>
                    <span>342</span>
                </button>
                <button class="action-btn share-btn" data-id="3">
                    <i class="far fa-share-alt"></i>
                    <span>分享</span>
                </button>
            </div>
        </div>
        
        <!-- 两图许愿 -->
        <div class="wish-item">
            <div class="wish-content">
                <div class="wish-header">
                    <div class="wish-avatar">
                        <img src="https://picsum.photos/id/237/100/100" alt="用户头像">
                    </div>
                    <div class="user-info">
                        <div class="user-name">音乐漫游者</div>
                        <div class="wish-time">1周前</div>
                    </div>
                </div>
                
                <div class="wish-text">
                    想组建一个小型乐队，寻找志同道合的音乐伙伴！我会吉他和作曲，希望能找到会键盘、贝斯和鼓的朋友，一起创作和表演原创音乐。
                </div>
                
                <div class="wish-images">
                    <div class="wish-image">
                        <img src="https://picsum.photos/id/1074/300/300" alt="乐队演出">
                    </div>
                    <div class="wish-image">
                        <img src="https://picsum.photos/id/1082/300/300" alt="音乐创作">
                    </div>
                </div>
                
                <div class="wish-tags">
                    <span class="wish-tag">音乐</span>
                    <span class="wish-tag">乐队</span>
                    <span class="wish-tag">合作</span>
                </div>
                
                <div class="wish-goal">
                    <div class="goal-label">
                        <i class="fas fa-users"></i>
                        <span>招募进度</span>
                    </div>
                    <div class="goal-progress">50% (2/4人)</div>
                </div>
            </div>
            
            <div class="wish-actions">
                <button class="action-btn comment-btn" data-id="4">
                    <i class="far fa-comment"></i>
                    <span>124</span>
                </button>
                <button class="action-btn support-btn" data-id="4">
                    <i class="far fa-hand-holding-heart"></i>
                    <span>98</span>
                </button>
                <button class="action-btn like-btn" data-id="4">
                    <i class="far fa-heart"></i>
                    <span>256</span>
                </button>
                <button class="action-btn share-btn" data-id="4">
                    <i class="far fa-share-alt"></i>
                    <span>分享</span>
                </button>
            </div>
        </div>
        
        <!-- 加载更多 -->
        <div class="load-more" id="loadMore">
            加载更多
        </div>
    </div>
    
    <!-- 发布许愿按钮 -->
    <button class="fab-button" id="addWishBtn">
        <i class="fas fa-plus"></i>
    </button>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-star"></i>
            <span>心愿墙</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-comment"></i>
            <span>消息</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息元素 -->
    <div class="toast-message" id="toastMessage"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById("backBtn");
        const searchBtn = document.getElementById("searchBtn");
        const addWishBtn = document.getElementById("addWishBtn");
        const loadMoreBtn = document.getElementById("loadMore");
        const wishesList = document.getElementById("wishesList");
        const toastMessage = document.getElementById("toastMessage");
        const categoryItems = document.querySelectorAll(".category-item");
        
        // 许愿数据
        const wishesData = [
            {
                id: 5,
                user: {
                    name: "书香门第",
                    avatar: "https://picsum.photos/id/177/100/100"
                },
                time: "1周前",
                text: "希望今年能读完50本书，目前已经完成12本。主要想读文学和历史类，有好书推荐的朋友可以留言哦！",
                images: [],
                tags: ["阅读", "目标", "文学"],
                goal: {
                    label: "阅读进度",
                    icon: "book-reader",
                    progress: "24% (12/50本)"
                },
                stats: {
                    comments: 36,
                    supports: 52,
                    likes: 143,
                    shared: false
                }
            },
            {
                id: 6,
                user: {
                    name: "篮球小子",
                    avatar: "https://picsum.photos/id/338/100/100"
                },
                time: "2周前",
                text: "希望能买到最新款的篮球鞋，下个月有一场重要的比赛。这双鞋的抓地力特别好，能提升我的表现！",
                images: [
                    "https://picsum.photos/id/1058/300/300"
                ],
                tags: ["运动", "篮球", "装备"],
                goal: {
                    label: "目标金额",
                    icon: "money-bill-wave",
                    progress: "80% (400/500元)"
                },
                stats: {
                    comments: 21,
                    supports: 37,
                    likes: 98,
                    shared: false
                }
            }
        ];
        
        // 初始化
        function init() {
            setupEventListeners();
        }
        
        // 设置事件监听
        function setupEventListeners() {
            // 返回按钮
            backBtn.addEventListener("click", () => {
                history.back();
            });
            
            // 搜索按钮
            searchBtn.addEventListener("click", () => {
                showToast("打开搜索功能");
            });
            
            // 发布许愿按钮
            addWishBtn.addEventListener("click", () => {
                showToast("打开发布许愿页面");
            });
            
            // 加载更多
            loadMoreBtn.addEventListener("click", loadMoreWishes);
            
            // 分类筛选
            categoryItems.forEach(item => {
                item.addEventListener("click", function() {
                    // 移除其他分类的活跃状态
                    categoryItems.forEach(i => i.classList.remove("active"));
                    // 添加当前分类的活跃状态
                    this.classList.add("active");
                    
                    const category = this.querySelector("span").textContent;
                    showToast(`筛选 ${category}`);
                    
                    // 这里可以根据分类重新加载数据
                });
            });
            
            // 许愿项操作
            document.addEventListener("click", (e) => {
                // 评论按钮
                if (e.target.closest(".comment-btn")) {
                    const btn = e.target.closest(".comment-btn");
                    const wishId = btn.getAttribute("data-id");
                    showToast(`查看许愿 ${wishId} 的评论`);
                }
                
                // 支持按钮
                if (e.target.closest(".support-btn")) {
                    const btn = e.target.closest(".support-btn");
                    const wishId = btn.getAttribute("data-id");
                    const icon = btn.querySelector("i");
                    const countElement = btn.querySelector("span");
                    let count = parseInt(countElement.textContent);
                    
                    // 切换支持状态
                    if (btn.classList.contains("supported")) {
                        btn.classList.remove("supported");
                        icon.classList.remove("fas");
                        icon.classList.add("far");
                        countElement.textContent = count - 1;
                        showToast("已取消支持");
                    } else {
                        btn.classList.add("supported");
                        icon.classList.remove("far");
                        icon.classList.add("fas");
                        countElement.textContent = count + 1;
                        showToast("支持成功");
                    }
                }
                
                // 点赞按钮
                if (e.target.closest(".like-btn")) {
                    const btn = e.target.closest(".like-btn");
                    const wishId = btn.getAttribute("data-id");
                    const icon = btn.querySelector("i");
                    const countElement = btn.querySelector("span");
                    let count = parseInt(countElement.textContent);
                    
                    // 切换点赞状态
                    if (btn.classList.contains("liked")) {
                        btn.classList.remove("liked");
                        icon.classList.remove("fas");
                        icon.classList.add("far");
                        countElement.textContent = count - 1;
                        showToast("已取消点赞");
                    } else {
                        btn.classList.add("liked");
                        icon.classList.remove("far");
                        icon.classList.add("fas");
                        countElement.textContent = count + 1;
                        showToast("点赞成功");
                    }
                }
                
                // 分享按钮
                if (e.target.closest(".share-btn")) {
                    const btn = e.target.closest(".share-btn");
                    const wishId = btn.getAttribute("data-id");
                    showToast("分享成功");
                }
                
                // 图片点击
                if (e.target.closest(".wish-image img")) {
                    const imgSrc = e.target.getAttribute("src");
                    showToast("查看大图");
                }
            });
        }
        
        // 加载更多许愿
        function loadMoreWishes() {
            // 显示加载状态
            loadMoreBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 加载中...';
            loadMoreBtn.style.pointerEvents = "none";
            
            // 模拟加载延迟
            setTimeout(() => {
                // 加载更多数据
                wishesData.forEach(wish => {
                    const wishElement = createWishElement(wish);
                    // 插入到加载更多按钮之前
                    wishesList.insertBefore(wishElement, loadMoreBtn);
                });
                
                // 恢复加载更多按钮状态
                loadMoreBtn.innerHTML = "加载更多";
                loadMoreBtn.style.pointerEvents = "auto";
                
                showToast("加载成功");
            }, 1000);
        }
        
        // 创建许愿元素
        function createWishElement(wish) {
            const wishElement = document.createElement("div");
            wishElement.className = "wish-item";
            
            // 构建图片HTML
            let imagesHtml = "";
            if (wish.images && wish.images.length > 0) {
                imagesHtml = `<div class="wish-images">`;
                wish.images.forEach(img => {
                    imagesHtml += `
                        <div class="wish-image">
                            <img src="${img}" alt="许愿图片">
                        </div>
                    `;
                });
                imagesHtml += `</div>`;
            }
            
            // 构建标签HTML
            let tagsHtml = "";
            wish.tags.forEach(tag => {
                tagsHtml += `<span class="wish-tag">${tag}</span>`;
            });
            
            // 操作按钮状态
            const supportClass = wish.stats.supports > 0 ? "supported" : "";
            const supportIcon = wish.stats.supports > 0 ? "fas" : "far";
            const likeClass = wish.stats.likes > 100 ? "liked" : "";
            const likeIcon = wish.stats.likes > 100 ? "fas" : "far";
            
            // 组装许愿项HTML
            wishElement.innerHTML = `
                <div class="wish-content">
                    <div class="wish-header">
                        <div class="wish-avatar">
                            <img src="${wish.user.avatar}" alt="${wish.user.name}的头像">
                        </div>
                        <div class="user-info">
                            <div class="user-name">${wish.user.name}</div>
                            <div class="wish-time">${wish.time}</div>
                        </div>
                    </div>
                    
                    <div class="wish-text">
                        ${wish.text}
                    </div>
                    
                    ${imagesHtml}
                    
                    <div class="wish-tags">
                        ${tagsHtml}
                    </div>
                    
                    <div class="wish-goal">
                        <div class="goal-label">
                            <i class="fas fa-${wish.goal.icon}"></i>
                            <span>${wish.goal.label}</span>
                        </div>
                        <div class="goal-progress">${wish.goal.progress}</div>
                    </div>
                </div>
                
                <div class="wish-actions">
                    <button class="action-btn comment-btn" data-id="${wish.id}">
                        <i class="far fa-comment"></i>
                        <span>${wish.stats.comments}</span>
                    </button>
                    <button class="action-btn support-btn ${supportClass}" data-id="${wish.id}">
                        <i class="${supportIcon} fa-hand-holding-heart"></i>
                        <span>${wish.stats.supports}</span>
                    </button>
                    <button class="action-btn like-btn ${likeClass}" data-id="${wish.id}">
                        <i class="${likeIcon} fa-heart"></i>
                        <span>${wish.stats.likes}</span>
                    </button>
                    <button class="action-btn share-btn" data-id="${wish.id}">
                        <i class="far fa-share-alt"></i>
                        <span>分享</span>
                    </button>
                </div>
            `;
            
            return wishElement;
        }
        
        // 显示提示消息
        function showToast(message) {
            // 设置消息内容
            toastMessage.textContent = message;
            
            // 显示消息
            toastMessage.classList.add("show");
            
            // 3秒后隐藏
            setTimeout(() => {
                toastMessage.classList.remove("show");
            }, 3000);
        }
        
        // 初始化页面
        document.addEventListener("DOMContentLoaded", init);
    </script>
</body>
</html>
